package 并发编程.proxy;

public class App {
    public static void main(String args[]) throws InstantiationException, IllegalAccessException {
        SalerProxy proxyFactory = new SalerProxy();
        // 售卖动物玩具
        ToyCompany animalToyEmployee = (ToyCompany) proxyFactory.getProxyInstance(AnimalToyEmployee.class);
        animalToyEmployee.sale();
        // 售卖机器人玩具
        ToyCompany robotToyEmployee = (ToyCompany) proxyFactory.getProxyInstance(RobotToyEmployee.class);
        robotToyEmployee.sale();

        ProxyUtil.generateClassFile(animalToyEmployee.getClass(), animalToyEmployee.getClass().getName());
        ProxyUtil.generateClassFile(robotToyEmployee.getClass(), robotToyEmployee.getClass().getName());

    }
}
